
import Taro from "@tarojs/taro"
export const add = (res) => {
    return {
        type: 'ADD',
        payLoad: res
    }
}
export const minus = () => {
    return {
        type: 'MINUS'
    }
}

// 异步的 action
export const asyncAdd = function () {
    return dispatch => {
        console.log(Taro)
        Taro.getSystemInfo({
            success(res) {
                const safeHeight: number = res.screenHeight - res.safeArea.bottom
                console.log("安全高度", safeHeight)
                dispatch(add(safeHeight))
            }
        })
    }
}